updating oE or_all

or_all

include math.e 
namespace math 
public function or_all(object a) 

or's together all atoms in the argument, no matter how deeply nested.

Parameters:
  1. values : an object, all atoms of which will be added up, no matter how nested.
Returns:

An atom, the result of bitwise or of all atoms in flatten(values).

Comments:

This function may be applied to an atom or to all elements of a sequence. It performs or_bits operations repeatedly.

Example 1:
a = or_all({10, 7, 35}) 
-- a is 47  
-- To see why notice: 
-- 10=0b1010, 7=0b111 and 35=0b100011. 
-- combining these gives: 
--               0b001010 
--      (or_bits)0b000111 
--               0b100011 
--               -------- 
--               0b101111 = 47 
See Also:

sum, product, or_bits

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu